/**
 ******************************************************************************
 * @file    ilopmain.c
 * @author  QQ Ding
 * @version V1.0.0
 * @date    3-Sept-2018
 * @brief   ILOP Service Main function
 ******************************************************************************
 *
 * Copyright (c) 2009-2018 MXCHIP Co.,Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ******************************************************************************
 */

#include "alicloud_ilop.h"
#include "mx_common.h"
#include "mx_debug.h"

#include "emh_api.h"
#include "main.h"
#include "mx_cli.h"
#include "mx_hal.h"

static int awss_start = 0;
static int awss_press = 0;
static int reset = 0;

#ifdef  USE_DOMAIN_GLOBAL
const char thing[] = "{\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a1MeLuIJPYL\"},\"services\":[{\"outputData\":[],\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"method\":\"thing.service.property.set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性设置\"},{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"get\",\"inputData\":[\"LightSwitch\",\"ColorTemperature\",\"NightLightSwitch\",\"WorkMode\",\"RGBColor\"],\"method\":\"thing.service.property.get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性获取\"},{\"outputData\":[],\"identifier\":\"TimeReset\",\"inputData\":[{\"identifier\":\"TimeReset\",\"dataType\":{\"specs\":{\"length\":\"255\"},\"type\":\"text\"},\"name\":\"TimeReset\"}],\"method\":\"thing.service.TimeReset\",\"name\":\"设备校时服务\",\"required\":false,\"callType\":\"async\"}],\"properties\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\",\"accessMode\":\"rw\",\"required\":true},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\",\"accessMode\":\"rw\",\"required\":false}],\"events\":[{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"post\",\"method\":\"thing.event.property.post\",\"name\":\"post\",\"type\":\"info\",\"required\":true,\"desc\":\"属性上报\"},{\"outputData\":[{\"identifier\":\"ErrorCode\",\"dataType\":{\"specs\":{\"0\":\"恢复正常\"},\"type\":\"enum\"},\"name\":\"故障代码\"}],\"identifier\":\"Error\",\"method\":\"thing.event.Error.post\",\"name\":\"故障上报\",\"type\":\"error\",\"required\":true}]}";

const emh_ilop_config_t ilop_config = {
    .tsl_thing = thing,
    .tsl_len = strlen(thing),
    .dm = EMH_ARG_ILOP_DM_ICA_BY_LOCAL,
    .domain = EMH_ARG_ILOP_DOMAIN_SINGAPORE,
};

const ilop_device_key_t device_key = {
    .product_key = "a1JjSehcuht",
    .product_secret = "K2l3CXzeiRgaaCEt",
    .device_name = "light_g",
    .device_secret = "gCk4yIDdXce7mdSrhJbpZyC9z3PiqjfB",
};
#else

#ifdef USE_MOC108
#define TSL_ARRAY_LEN (5746)

static const unsigned char tsl_array[]={
0x7b,0x22,0x73,0x63,0x68,0x65,0x6d,0x61,0x22,0x3a,0x22,0x68,0x74,0x74,0x70,0x73,
0x3a,0x2f,0x2f,0x69,0x6f,0x74,0x78,0x2d,0x74,0x73,0x6c,0x2e,0x6f,0x73,0x73,0x2d,
0x2b,0xa9,0x61,0x70,0x2d,0x73,0x6f,0x75,0x74,0x68,0x65,0x61,0x73,0x74,0x2d,0x31,
0x2e,0x61,0x6c,0x69,0x79,0x75,0x6e,0x63,0x73,0x2e,0x63,0x6f,0x6d,0x2f,0x73,0x63,
0x68,0x65,0x4b,0x2c,0x6d,0x61,0x2e,0x6a,0x73,0x6f,0x6e,0x22,0x2c,0x22,0x70,0x72,
0x6f,0x66,0x69,0x6c,0x65,0x22,0x3a,0x7b,0x22,0x70,0x72,0x6f,0x64,0x75,0x63,0x74,
0x4b,0x65,0x79,0x22,0xf8,0xb3,0x3a,0x22,0x61,0x31,0x4d,0x65,0x4c,0x75,0x49,0x4a,
0x50,0x59,0x4c,0x22,0x7d,0x2c,0x22,0x73,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x22,
0x3a,0x5b,0x7b,0x22,0x6f,0x75,0x83,0x6f,0x74,0x70,0x75,0x74,0x44,0x61,0x74,0x61,
0x22,0x3a,0x5b,0x5d,0x2c,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,
0x22,0x3a,0x22,0x73,0x65,0x74,0x22,0x2c,0x72,0xf4,0x22,0x69,0x6e,0x70,0x75,0x74,
0x44,0x61,0x74,0x61,0x22,0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,
0x69,0x65,0x72,0x22,0x3a,0x22,0x4c,0x69,0x67,0x68,0x64,0xb1,0x74,0x53,0x77,0x69,
0x74,0x63,0x68,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,
0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x1b,0x7c,0x22,0x3a,
0x22,0xe5,0x85,0xb3,0xe9,0x97,0xad,0x22,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe5,0xbc,
0x80,0xe5,0x90,0xaf,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x7a,0x48,
0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,
0xe4,0xb8,0xbb,0xe7,0x81,0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x7d,0x2c,0x7b,
0xb5,0x0d,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,
0x43,0x6f,0x6c,0x6f,0x72,0x54,0x65,0x6d,0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,
0x22,0x2c,0x5f,0xbf,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,
0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x75,0x6e,0x69,0x74,0x22,0x3a,
0x22,0x4b,0x22,0x2c,0x99,0x28,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x32,0x37,0x30,
0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,
0xbc,0x80,0xe5,0xb0,0x94,0xe6,0x0f,0x48,0x96,0x87,0x22,0x2c,0x22,0x6d,0x61,0x78,
0x22,0x3a,0x22,0x36,0x35,0x30,0x30,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,
0x22,0x31,0x30,0x30,0x22,0x7d,0x2c,0x22,0x9b,0x0b,0x74,0x79,0x70,0x65,0x22,0x3a,
0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,
0x86,0xb7,0xe6,0x9a,0x96,0xe8,0x89,0xb2,0xe6,0xb8,0xc4,0x19,0xa9,0x22,0x7d,0x2c,
0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x4e,
0x69,0x67,0x68,0x74,0x4c,0x69,0x67,0x68,0x74,0x53,0x77,0x69,0x20,0x4a,0x74,0x63,
0x68,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,
0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe5,0x82,0x84,
0x85,0xb3,0xe9,0x97,0xad,0x22,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe5,0xbc,0x80,0xe5,
0x90,0xaf,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,
0x18,0xd6,0x6c,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xa4,
0x9c,0xe7,0x81,0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x7d,0x2c,0x7b,0x22,0x69,
0x64,0x65,0x06,0x00,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x57,0x6f,
0x72,0x6b,0x4d,0x6f,0x64,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,
0x65,0x22,0x3a,0x7b,0xc0,0xba,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,
0x30,0x22,0x3a,0x22,0xe6,0x89,0x8b,0xe5,0x8a,0xa8,0x22,0x2c,0x22,0x31,0x22,0x3a,
0x22,0xe9,0x98,0x85,0xe8,0xaf,0x47,0x4f,0xbb,0x22,0x2c,0x22,0x32,0x22,0x3a,0x22,
0xe5,0xbd,0xb1,0xe9,0x99,0xa2,0x22,0x2c,0x22,0x33,0x22,0x3a,0x22,0xe5,0xa4,0x9c,
0xe7,0x81,0xaf,0x22,0x2c,0x22,0x34,0x22,0x0f,0x42,0x3a,0x22,0xe7,0x94,0x9f,0xe6,
0xb4,0xbb,0x22,0x2c,0x22,0x35,0x22,0x3a,0x22,0xe6,0x9f,0x94,0xe5,0x92,0x8c,0x22,
0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0xcc,0x73,0x65,0x6e,0x75,0x6d,
0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xb7,0xa5,0xe4,0xbd,
0x9c,0xe6,0xa8,0xa1,0xe5,0xbc,0x8f,0x22,0x7d,0x2c,0x7b,0x22,0x84,0xdf,0x69,0x64,
0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x52,0x47,0x42,0x43,0x6f,
0x6c,0x6f,0x72,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x12,0x6d,
0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x5b,0x7b,0x22,0x69,0x64,
0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x52,0x65,0x64,0x22,0x2c,
0xab,0x06,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,
0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,
0x2c,0x22,0x27,0xc9,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe6,
0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,
0x22,0x73,0x74,0x65,0xf1,0xc8,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,0x74,
0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,
0x65,0x22,0x3a,0x22,0xe7,0xba,0x39,0x58,0xa2,0xe8,0x89,0xb2,0x22,0x7d,0x2c,0x7b,
0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x47,0x72,
0x65,0x65,0x6e,0x22,0x2c,0x22,0x64,0x61,0xcb,0x21,0x74,0x61,0x54,0x79,0x70,0x65,
0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,
0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0xa2,0x73,0x74,0x4e,0x61,0x6d,
0x65,0x22,0x3a,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,
0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0xf2,0x11,0x22,0x31,
0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,
0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe7,0xbb,0xbf,0xe8,0x89,0xf0,0x3b,
0xb2,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,
0x22,0x3a,0x22,0x42,0x6c,0x75,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,
0x9c,0x3c,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,
0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,
0x61,0x6d,0x4a,0x7e,0x65,0x22,0x3a,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,
0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,
0x22,0x31,0x22,0x7d,0x02,0xa8,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,
0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe8,0x93,0x9d,
0xe8,0x89,0xb2,0x22,0x7d,0x5d,0x04,0x24,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,
0x22,0x73,0x74,0x72,0x75,0x63,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,
0x3a,0x22,0x52,0x47,0x42,0xe8,0xb0,0x83,0x9b,0x4a,0xe8,0x89,0xb2,0x22,0x7d,0x5d,
0x2c,0x22,0x6d,0x65,0x74,0x68,0x6f,0x64,0x22,0x3a,0x22,0x74,0x68,0x69,0x6e,0x67,
0x2e,0x73,0x65,0x72,0x76,0x69,0x63,0x65,0x2e,0x70,0x9d,0x62,0x72,0x6f,0x70,0x65,
0x72,0x74,0x79,0x2e,0x73,0x65,0x74,0x22,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,
0x22,0x73,0x65,0x74,0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0x69,0x1b,0x72,0x72,0x65,
0x64,0x22,0x3a,0x74,0x72,0x75,0x65,0x2c,0x22,0x63,0x61,0x6c,0x6c,0x54,0x79,0x70,
0x65,0x22,0x3a,0x22,0x61,0x73,0x79,0x6e,0x63,0x22,0x2c,0x22,0x64,0x65,0x3d,0xf3,
0x73,0x63,0x22,0x3a,0x22,0xe5,0xb1,0x9e,0xe6,0x80,0xa7,0xe8,0xae,0xbe,0xe7,0xbd,
0xae,0x22,0x7d,0x2c,0x7b,0x22,0x6f,0x75,0x74,0x70,0x75,0x74,0x44,0x61,0x74,0x61,
0xe7,0x14,0x22,0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,
0x72,0x22,0x3a,0x22,0x4c,0x69,0x67,0x68,0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,
0x2c,0x22,0xd3,0x2c,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,
0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe5,0x85,0xb3,
0xe9,0x97,0xad,0x22,0x73,0xd4,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe5,0xbc,0x80,0xe5,
0x90,0xaf,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,
0x6c,0x22,0x7d,0x2c,0x22,0x6e,0x82,0xbe,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe4,0xb8,
0xbb,0xe7,0x81,0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x7d,0x2c,0x7b,0x22,0x69,
0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x5d,0x6f,0x72,0x22,0x3a,0x22,0x43,0x6f,
0x6c,0x6f,0x72,0x54,0x65,0x6d,0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,0x22,0x2c,
0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0xec,0xac,0x3a,0x7b,0x22,0x73,
0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x75,0x6e,0x69,0x74,0x22,0x3a,0x22,0x4b,
0x22,0x2c,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x32,0x37,0x30,0x94,0x70,0x30,0x22,
0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xbc,0x80,
0xe5,0xb0,0x94,0xe6,0x96,0x87,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0xf2,0x66,
0x22,0x36,0x35,0x30,0x30,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,
0x30,0x30,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,
0x36,0x41,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0x86,0xb7,
0xe6,0x9a,0x96,0xe8,0x89,0xb2,0xe6,0xb8,0xa9,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,
0x65,0x6e,0x51,0xf4,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x4e,0x69,0x67,
0x68,0x74,0x4c,0x69,0x67,0x68,0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,
0x64,0x61,0x74,0x61,0x5f,0xeb,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,
0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe5,0x85,0xb3,0xe9,0x97,
0xad,0x22,0x2c,0x22,0x31,0x22,0x15,0x80,0x3a,0x22,0xe5,0xbc,0x80,0xe5,0x90,0xaf,
0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,0x6c,0x22,
0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x80,0xc1,0x3a,0x22,0xe5,0xa4,0x9c,0xe7,
0x81,0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,
0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0xb9,0x44,0x57,0x6f,0x72,0x6b,
0x4d,0x6f,0x64,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,
0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x5a,0xf4,0x30,0x22,
0x3a,0x22,0xe6,0x89,0x8b,0xe5,0x8a,0xa8,0x22,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe9,
0x98,0x85,0xe8,0xaf,0xbb,0x22,0x2c,0x22,0x32,0x22,0x3a,0x22,0xe5,0xbd,0x9a,0xec,
0xb1,0xe9,0x99,0xa2,0x22,0x2c,0x22,0x33,0x22,0x3a,0x22,0xe5,0xa4,0x9c,0xe7,0x81,
0xaf,0x22,0x2c,0x22,0x34,0x22,0x3a,0x22,0xe7,0x94,0x9f,0xe6,0xb4,0xbb,0x22,0x2c,
0x2a,0xfe,0x22,0x35,0x22,0x3a,0x22,0xe6,0x9f,0x94,0xe5,0x92,0x8c,0x22,0x7d,0x2c,
0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x65,0x6e,0x75,0x6d,0x22,0x7d,0x2c,0x22,
0x6e,0x61,0x3b,0xb9,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xb7,0xa5,0xe4,0xbd,0x9c,0xe6,
0xa8,0xa1,0xe5,0xbc,0x8f,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,
0x66,0x69,0x65,0x72,0xaf,0x5d,0x22,0x3a,0x22,0x52,0x47,0x42,0x43,0x6f,0x6c,0x6f,
0x72,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,
0x73,0x70,0x65,0x63,0x73,0x22,0x62,0x3d,0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,
0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x52,0x65,0x64,0x22,0x2c,0x22,0x64,
0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x93,0x42,0x3a,0x7b,0x22,0x73,0x70,0x65,
0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,
0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x06,0x56,0x22,0xe6,0x97,0xa0,
0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,
0x74,0x65,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,0x74,0x60,0x5d,0x79,0x70,
0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,
0x3a,0x22,0xe7,0xba,0xa2,0xe8,0x89,0xb2,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x27,0x89,
0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x47,0x72,0x65,0x65,
0x6e,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,
0xa4,0x89,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,
0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,
0xe6,0x97,0xf6,0xa0,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,
0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,
0x74,0x79,0x70,0x65,0xe4,0x52,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,
0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe7,0xbb,0xbf,0xe8,0x89,0xb2,0x22,0x7d,0x2c,
0x7b,0x22,0x69,0x64,0x65,0x6e,0xa8,0x76,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,
0x22,0x42,0x6c,0x75,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,
0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0xa0,0xac,0x73,0x22,0x3a,0x7b,0x22,0x6d,
0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,
0x65,0x22,0x3a,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0xca,0x54,0x6d,0x61,0x78,0x22,
0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,
0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x41,0xa9,0x6e,0x74,
0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe8,0x93,0x9d,0xe8,0x89,
0xb2,0x22,0x7d,0x5d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x73,0x85,0x46,
0x74,0x72,0x75,0x63,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,
0x52,0x47,0x42,0xe8,0xb0,0x83,0xe8,0x89,0xb2,0x22,0x7d,0x5d,0x2c,0x22,0x69,0x64,
0x1f,0x97,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x67,0x65,0x74,
0x22,0x2c,0x22,0x69,0x6e,0x70,0x75,0x74,0x44,0x61,0x74,0x61,0x22,0x3a,0x5b,0x22,
0x4c,0x69,0x4e,0xdd,0x67,0x68,0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,
0x43,0x6f,0x6c,0x6f,0x72,0x54,0x65,0x6d,0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,
0x22,0x2c,0x22,0x4e,0xc1,0x5c,0x69,0x67,0x68,0x74,0x4c,0x69,0x67,0x68,0x74,0x53,
0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,0x57,0x6f,0x72,0x6b,0x4d,0x6f,0x64,0x65,
0x22,0x2c,0x22,0x52,0x47,0x42,0x2c,0xe9,0x43,0x6f,0x6c,0x6f,0x72,0x22,0x5d,0x2c,
0x22,0x6d,0x65,0x74,0x68,0x6f,0x64,0x22,0x3a,0x22,0x74,0x68,0x69,0x6e,0x67,0x2e,
0x73,0x65,0x72,0x76,0x69,0x63,0x65,0x2e,0xe2,0x89,0x70,0x72,0x6f,0x70,0x65,0x72,
0x74,0x79,0x2e,0x67,0x65,0x74,0x22,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,
0x67,0x65,0x74,0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0xd3,0xdd,0x69,0x72,0x65,0x64,
0x22,0x3a,0x74,0x72,0x75,0x65,0x2c,0x22,0x63,0x61,0x6c,0x6c,0x54,0x79,0x70,0x65,
0x22,0x3a,0x22,0x61,0x73,0x79,0x6e,0x63,0x22,0x2c,0x22,0x64,0x7c,0x82,0x65,0x73,
0x63,0x22,0x3a,0x22,0xe5,0xb1,0x9e,0xe6,0x80,0xa7,0xe8,0x8e,0xb7,0xe5,0x8f,0x96,
0x22,0x7d,0x2c,0x7b,0x22,0x6f,0x75,0x74,0x70,0x75,0x74,0x44,0x61,0x74,0xad,0x77,
0x61,0x22,0x3a,0x5b,0x5d,0x2c,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,
0x72,0x22,0x3a,0x22,0x54,0x69,0x6d,0x65,0x52,0x65,0x73,0x65,0x74,0x22,0x2c,0x22,
0x97,0x87,0x69,0x6e,0x70,0x75,0x74,0x44,0x61,0x74,0x61,0x22,0x3a,0x5b,0x7b,0x22,
0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x54,0x69,0x6d,
0x65,0x52,0x3c,0x0d,0x65,0x73,0x65,0x74,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,
0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,
0x6c,0x65,0x6e,0x67,0xec,0x78,0x74,0x68,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x7d,
0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x74,0x65,0x78,0x74,0x22,0x7d,0x2c,
0x22,0x6e,0x61,0x6d,0x65,0x22,0xc0,0xa2,0x3a,0x22,0x54,0x69,0x6d,0x65,0x52,0x65,
0x73,0x65,0x74,0x22,0x7d,0x5d,0x2c,0x22,0x6d,0x65,0x74,0x68,0x6f,0x64,0x22,0x3a,
0x22,0x74,0x68,0x69,0x6e,0x67,0x2e,0x73,0xfb,0x11,0x65,0x72,0x76,0x69,0x63,0x65,
0x2e,0x54,0x69,0x6d,0x65,0x52,0x65,0x73,0x65,0x74,0x22,0x2c,0x22,0x6e,0x61,0x6d,
0x65,0x22,0x3a,0x22,0xe8,0xae,0xbe,0xe5,0xa4,0x87,0x18,0xee,0xe6,0xa0,0xa1,0xe6,
0x97,0xb6,0xe6,0x9c,0x8d,0xe5,0x8a,0xa1,0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0x69,
0x72,0x65,0x64,0x22,0x3a,0x66,0x61,0x6c,0x73,0x65,0x2c,0x22,0xd3,0xb1,0x63,0x61,
0x6c,0x6c,0x54,0x79,0x70,0x65,0x22,0x3a,0x22,0x61,0x73,0x79,0x6e,0x63,0x22,0x7d,
0x5d,0x2c,0x22,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x69,0x65,0x73,0x22,0xcb,0x28,
0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,
0x22,0x4c,0x69,0x67,0x68,0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,0x64,
0x08,0xc0,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,
0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe5,0x85,0xb3,0xe9,0x97,0xad,
0x22,0x2c,0x68,0xdb,0x22,0x31,0x22,0x3a,0x22,0xe5,0xbc,0x80,0xe5,0x90,0xaf,0x22,
0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,
0x2c,0x22,0x6e,0x61,0x99,0x30,0x6d,0x65,0x22,0x3a,0x22,0xe4,0xb8,0xbb,0xe7,0x81,
0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x2c,0x22,0x61,0x63,0x63,0x65,0x73,0x73,
0x4d,0x6f,0x64,0x65,0x22,0x3a,0x06,0xf3,0x22,0x72,0x77,0x22,0x2c,0x22,0x72,0x65,
0x71,0x75,0x69,0x72,0x65,0x64,0x22,0x3a,0x74,0x72,0x75,0x65,0x7d,0x2c,0x7b,0x22,
0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0xee,0x3b,0x65,0x72,0x22,0x3a,0x22,0x43,
0x6f,0x6c,0x6f,0x72,0x54,0x65,0x6d,0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,0x22,
0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0xf9,0xd3,0x22,0x3a,0x7b,0x22,
0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x75,0x6e,0x69,0x74,0x22,0x3a,0x22,
0x4b,0x22,0x2c,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x32,0x37,0xcf,0xb1,0x30,0x30,
0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xbc,
0x80,0xe5,0xb0,0x94,0xe6,0x96,0x87,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0xb8,0xd0,
0x3a,0x22,0x36,0x35,0x30,0x30,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,
0x31,0x30,0x30,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,
0x4c,0x94,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0x86,
0xb7,0xe6,0x9a,0x96,0xe8,0x89,0xb2,0xe6,0xb8,0xa9,0x22,0x2c,0x22,0x61,0x63,0x63,
0x65,0x73,0x71,0x27,0x73,0x4d,0x6f,0x64,0x65,0x22,0x3a,0x22,0x72,0x77,0x22,0x2c,
0x22,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x22,0x3a,0x66,0x61,0x6c,0x73,0x65,
0x7d,0x2c,0x7b,0x22,0xa3,0xc3,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,
0x22,0x3a,0x22,0x4e,0x69,0x67,0x68,0x74,0x4c,0x69,0x67,0x68,0x74,0x53,0x77,0x69,
0x74,0x63,0x68,0x22,0x2c,0x22,0x82,0xad,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,
0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,
0x22,0xe5,0x85,0xb3,0xe9,0x97,0xad,0x22,0x73,0xd4,0x2c,0x22,0x31,0x22,0x3a,0x22,
0xe5,0xbc,0x80,0xe5,0x90,0xaf,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,
0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,0x2c,0x22,0x6e,0x82,0xbe,0x61,0x6d,0x65,0x22,
0x3a,0x22,0xe5,0xa4,0x9c,0xe7,0x81,0xaf,0xe5,0xbc,0x80,0xe5,0x85,0xb3,0x22,0x2c,
0x22,0x61,0x63,0x63,0x65,0x73,0x73,0x4d,0x6f,0x64,0x65,0x22,0xb1,0xc8,0x3a,0x22,
0x72,0x77,0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x22,0x3a,0x66,
0x61,0x6c,0x73,0x65,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x64,0x85,
0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x57,0x6f,0x72,0x6b,0x4d,0x6f,0x64,0x65,0x22,
0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,
0xd8,0x74,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe6,0x89,0x8b,
0xe5,0x8a,0xa8,0x22,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe9,0x98,0x85,0xe8,0xaf,0xbb,
0x22,0x2c,0xd5,0x07,0x22,0x32,0x22,0x3a,0x22,0xe5,0xbd,0xb1,0xe9,0x99,0xa2,0x22,
0x2c,0x22,0x33,0x22,0x3a,0x22,0xe5,0xa4,0x9c,0xe7,0x81,0xaf,0x22,0x2c,0x22,0x34,
0x22,0x3a,0x22,0xe7,0x6d,0xfc,0x94,0x9f,0xe6,0xb4,0xbb,0x22,0x2c,0x22,0x35,0x22,
0x3a,0x22,0xe6,0x9f,0x94,0xe5,0x92,0x8c,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,
0x22,0x3a,0x22,0x65,0x6e,0x75,0x70,0x99,0x6d,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,
0x65,0x22,0x3a,0x22,0xe5,0xb7,0xa5,0xe4,0xbd,0x9c,0xe6,0xa8,0xa1,0xe5,0xbc,0x8f,
0x22,0x2c,0x22,0x61,0x63,0x63,0x65,0x73,0x92,0x7b,0x73,0x4d,0x6f,0x64,0x65,0x22,
0x3a,0x22,0x72,0x77,0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x22,
0x3a,0x66,0x61,0x6c,0x73,0x65,0x7d,0x2c,0x7b,0x22,0xa3,0xc3,0x69,0x64,0x65,0x6e,
0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x52,0x47,0x42,0x43,0x6f,0x6c,0x6f,
0x72,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x12,0x6d,0x22,0x3a,
0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,
0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x52,0x65,0x64,0x22,0x2c,0xab,0x06,
0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,
0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,
0x27,0xc9,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe6,0x97,0xa0,
0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,
0x74,0x65,0xf1,0xc8,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,
0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,
0x3a,0x22,0xe7,0xba,0x39,0x58,0xa2,0xe8,0x89,0xb2,0x22,0x7d,0x2c,0x7b,0x22,0x69,
0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x47,0x72,0x65,0x65,
0x6e,0x22,0x2c,0x22,0x64,0x61,0xcb,0x21,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,
0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,
0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0xa2,0x73,0x74,0x4e,0x61,0x6d,0x65,0x22,
0x3a,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,
0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0xf2,0x11,0x22,0x31,0x22,0x7d,
0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,
0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe7,0xbb,0xbf,0xe8,0x89,0xf0,0x3b,0xb2,0x22,
0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,
0x22,0x42,0x6c,0x75,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x9c,0x3c,
0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x6d,
0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,
0x4a,0x7e,0x65,0x22,0x3a,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,
0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,
0x22,0x7d,0x02,0xa8,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,
0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe8,0x93,0x9d,0xe8,0x89,
0xb2,0x22,0x7d,0x5d,0x04,0x24,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x73,
0x74,0x72,0x75,0x63,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,
0x52,0x47,0x42,0xe8,0xb0,0x83,0x9b,0x4a,0xe8,0x89,0xb2,0x22,0x2c,0x22,0x61,0x63,
0x63,0x65,0x73,0x73,0x4d,0x6f,0x64,0x65,0x22,0x3a,0x22,0x72,0x77,0x22,0x2c,0x22,
0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x9e,0x6a,0x22,0x3a,0x66,0x61,0x6c,0x73,
0x65,0x7d,0x5d,0x2c,0x22,0x65,0x76,0x65,0x6e,0x74,0x73,0x22,0x3a,0x5b,0x7b,0x22,
0x6f,0x75,0x74,0x70,0x75,0x74,0x44,0x61,0x74,0x61,0xd9,0xa6,0x22,0x3a,0x5b,0x7b,
0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x4c,0x69,
0x67,0x68,0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,0xd3,0x2c,0x64,0x61,
0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,
0x3a,0x7b,0x22,0x30,0x22,0x3a,0x22,0xe5,0x85,0xb3,0xe9,0x97,0xad,0x22,0x73,0xd4,
0x2c,0x22,0x31,0x22,0x3a,0x22,0xe5,0xbc,0x80,0xe5,0x90,0xaf,0x22,0x7d,0x2c,0x22,
0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,0x2c,0x22,0x6e,
0x82,0xbe,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe4,0xb8,0xbb,0xe7,0x81,0xaf,0xe5,0xbc,
0x80,0xe5,0x85,0xb3,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,
0x69,0x65,0x5d,0x6f,0x72,0x22,0x3a,0x22,0x43,0x6f,0x6c,0x6f,0x72,0x54,0x65,0x6d,
0x70,0x65,0x72,0x61,0x74,0x75,0x72,0x65,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,
0x79,0x70,0x65,0x22,0xec,0xac,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,
0x7b,0x22,0x75,0x6e,0x69,0x74,0x22,0x3a,0x22,0x4b,0x22,0x2c,0x22,0x6d,0x69,0x6e,
0x22,0x3a,0x22,0x32,0x37,0x30,0x94,0x70,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,
0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0xbc,0x80,0xe5,0xb0,0x94,0xe6,0x96,0x87,
0x22,0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0xf2,0x66,0x22,0x36,0x35,0x30,0x30,0x22,
0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,0x30,0x30,0x22,0x7d,0x2c,0x22,
0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x74,0x36,0x41,0x22,0x7d,0x2c,0x22,
0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe5,0x86,0xb7,0xe6,0x9a,0x96,0xe8,0x89,0xb2,
0xe6,0xb8,0xa9,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x51,0xf4,0x74,0x69,
0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x4e,0x69,0x67,0x68,0x74,0x4c,0x69,0x67,0x68,
0x74,0x53,0x77,0x69,0x74,0x63,0x68,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x5f,0xeb,
0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,
0x22,0x30,0x22,0x3a,0x22,0xe5,0x85,0xb3,0xe9,0x97,0xad,0x22,0x2c,0x22,0x31,0x22,
0x15,0x80,0x3a,0x22,0xe5,0xbc,0x80,0xe5,0x90,0xaf,0x22,0x7d,0x2c,0x22,0x74,0x79,
0x70,0x65,0x22,0x3a,0x22,0x62,0x6f,0x6f,0x6c,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,
0x65,0x22,0x80,0xc1,0x3a,0x22,0xe5,0xa4,0x9c,0xe7,0x81,0xaf,0xe5,0xbc,0x80,0xe5,
0x85,0xb3,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,
0x72,0x22,0x3a,0x22,0xb9,0x44,0x57,0x6f,0x72,0x6b,0x4d,0x6f,0x64,0x65,0x22,0x2c,
0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,
0x63,0x73,0x22,0x3a,0x7b,0x22,0x5a,0xf4,0x30,0x22,0x3a,0x22,0xe6,0x89,0x8b,0xe5,
0x8a,0xa8,0x22,0x2c,0x22,0x31,0x22,0x3a,0x22,0xe9,0x98,0x85,0xe8,0xaf,0xbb,0x22,
0x2c,0x22,0x32,0x22,0x3a,0x22,0xe5,0xbd,0x9a,0xec,0xb1,0xe9,0x99,0xa2,0x22,0x2c,
0x22,0x33,0x22,0x3a,0x22,0xe5,0xa4,0x9c,0xe7,0x81,0xaf,0x22,0x2c,0x22,0x34,0x22,
0x3a,0x22,0xe7,0x94,0x9f,0xe6,0xb4,0xbb,0x22,0x2c,0x2a,0xfe,0x22,0x35,0x22,0x3a,
0x22,0xe6,0x9f,0x94,0xe5,0x92,0x8c,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,
0x3a,0x22,0x65,0x6e,0x75,0x6d,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x3b,0xb9,0x6d,0x65,
0x22,0x3a,0x22,0xe5,0xb7,0xa5,0xe4,0xbd,0x9c,0xe6,0xa8,0xa1,0xe5,0xbc,0x8f,0x22,
0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0xaf,0x5d,
0x22,0x3a,0x22,0x52,0x47,0x42,0x43,0x6f,0x6c,0x6f,0x72,0x22,0x2c,0x22,0x64,0x61,
0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,
0x62,0x3d,0x3a,0x5b,0x7b,0x22,0x69,0x64,0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,
0x22,0x3a,0x22,0x52,0x65,0x64,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,
0x65,0x22,0x93,0x42,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,
0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,
0x6d,0x65,0x22,0x3a,0x06,0x56,0x22,0xe6,0x97,0xa0,0x22,0x2c,0x22,0x6d,0x61,0x78,
0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,
0x31,0x22,0x7d,0x2c,0x22,0x74,0x60,0x5d,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,
0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe7,0xba,0xa2,0xe8,
0x89,0xb2,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x27,0x89,0x64,0x65,0x6e,0x74,0x69,0x66,
0x69,0x65,0x72,0x22,0x3a,0x22,0x47,0x72,0x65,0x65,0x6e,0x22,0x2c,0x22,0x64,0x61,
0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0xa4,0x89,0x73,0x70,0x65,0x63,
0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,0x22,0x2c,0x22,0x75,
0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe6,0x97,0xf6,0xa0,0xa0,0x22,
0x2c,0x22,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,0x2c,0x22,0x73,0x74,
0x65,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0xe4,0x52,
0x22,0x3a,0x22,0x69,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,
0x22,0xe7,0xbb,0xbf,0xe8,0x89,0xb2,0x22,0x7d,0x2c,0x7b,0x22,0x69,0x64,0x65,0x6e,
0xa8,0x76,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x42,0x6c,0x75,0x65,0x22,
0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,
0x65,0x63,0xa0,0xac,0x73,0x22,0x3a,0x7b,0x22,0x6d,0x69,0x6e,0x22,0x3a,0x22,0x30,
0x22,0x2c,0x22,0x75,0x6e,0x69,0x74,0x4e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe6,0x97,
0xa0,0x22,0x2c,0x22,0xca,0x54,0x6d,0x61,0x78,0x22,0x3a,0x22,0x32,0x35,0x35,0x22,
0x2c,0x22,0x73,0x74,0x65,0x70,0x22,0x3a,0x22,0x31,0x22,0x7d,0x2c,0x22,0x74,0x79,
0x70,0x65,0x22,0x3a,0x22,0x69,0x41,0xa9,0x6e,0x74,0x22,0x7d,0x2c,0x22,0x6e,0x61,
0x6d,0x65,0x22,0x3a,0x22,0xe8,0x93,0x9d,0xe8,0x89,0xb2,0x22,0x7d,0x5d,0x2c,0x22,
0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x73,0x85,0x46,0x74,0x72,0x75,0x63,0x74,0x22,
0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0x52,0x47,0x42,0xe8,0xb0,0x83,
0xe8,0x89,0xb2,0x22,0x7d,0x5d,0x2c,0x22,0x69,0x64,0x1f,0x97,0x65,0x6e,0x74,0x69,
0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x70,0x6f,0x73,0x74,0x22,0x2c,0x22,0x6d,0x65,
0x74,0x68,0x6f,0x64,0x22,0x3a,0x22,0x74,0x68,0x69,0x6e,0x67,0x22,0x87,0x2e,0x65,
0x76,0x65,0x6e,0x74,0x2e,0x70,0x72,0x6f,0x70,0x65,0x72,0x74,0x79,0x2e,0x70,0x6f,
0x73,0x74,0x22,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0x70,0x6f,0xe1,0xd1,
0x73,0x74,0x22,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x69,0x6e,0x66,0x6f,
0x22,0x2c,0x22,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x22,0x3a,0x74,0x72,0x75,
0x75,0x09,0x65,0x2c,0x22,0x64,0x65,0x73,0x63,0x22,0x3a,0x22,0xe5,0xb1,0x9e,0xe6,
0x80,0xa7,0xe4,0xb8,0x8a,0xe6,0x8a,0xa5,0x22,0x7d,0x2c,0x7b,0x22,0x6f,0x75,0x74,
0x70,0x75,0xa5,0xce,0x74,0x44,0x61,0x74,0x61,0x22,0x3a,0x5b,0x7b,0x22,0x69,0x64,
0x65,0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0x45,0x72,0x72,0x6f,0x72,
0x43,0x6f,0x64,0x65,0xa2,0xc2,0x22,0x2c,0x22,0x64,0x61,0x74,0x61,0x54,0x79,0x70,
0x65,0x22,0x3a,0x7b,0x22,0x73,0x70,0x65,0x63,0x73,0x22,0x3a,0x7b,0x22,0x30,0x22,
0x3a,0x22,0xe6,0x81,0xa2,0xe5,0xd3,0xff,0xa4,0x8d,0xe6,0xad,0xa3,0xe5,0xb8,0xb8,
0x22,0x7d,0x2c,0x22,0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x65,0x6e,0x75,0x6d,0x22,
0x7d,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x16,0x38,0x3a,0x22,0xe6,0x95,0x85,0xe9,
0x9a,0x9c,0xe4,0xbb,0xa3,0xe7,0xa0,0x81,0x22,0x7d,0x5d,0x2c,0x22,0x69,0x64,0x65,
0x6e,0x74,0x69,0x66,0x69,0x65,0x72,0x22,0x3a,0x22,0xa9,0x6d,0x45,0x72,0x72,0x6f,
0x72,0x22,0x2c,0x22,0x6d,0x65,0x74,0x68,0x6f,0x64,0x22,0x3a,0x22,0x74,0x68,0x69,
0x6e,0x67,0x2e,0x65,0x76,0x65,0x6e,0x74,0x2e,0x45,0x72,0x72,0xd4,0xef,0x6f,0x72,
0x2e,0x70,0x6f,0x73,0x74,0x22,0x2c,0x22,0x6e,0x61,0x6d,0x65,0x22,0x3a,0x22,0xe6,
0x95,0x85,0xe9,0x9a,0x9c,0xe4,0xb8,0x8a,0xe6,0x8a,0xa5,0x22,0x2c,0x22,0x25,0x39,
0x74,0x79,0x70,0x65,0x22,0x3a,0x22,0x65,0x72,0x72,0x6f,0x72,0x22,0x2c,0x22,0x72,
0x65,0x71,0x75,0x69,0x72,0x65,0x64,0x22,0x3a,0x74,0x72,0x75,0x65,0x7d,0x5d,0x7d,
0x61,0xac};

const emh_ilop_config_t ilop_config = {
    .tsl_thing = tsl_array,
    .tsl_len = TSL_ARRAY_LEN,
    .dm = EMH_ARG_ILOP_DM_ICA_BY_LOCAL,
    .domain = EMH_ARG_ILOP_DOMAIN_SHANGHAI,
};

#else
const char thing[] = "{\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a1MeLuIJPYL\"},\"services\":[{\"outputData\":[],\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"method\":\"thing.service.property.set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性设置\"},{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"get\",\"inputData\":[\"LightSwitch\",\"ColorTemperature\",\"NightLightSwitch\",\"WorkMode\",\"RGBColor\"],\"method\":\"thing.service.property.get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性获取\"},{\"outputData\":[],\"identifier\":\"TimeReset\",\"inputData\":[{\"identifier\":\"TimeReset\",\"dataType\":{\"specs\":{\"length\":\"255\"},\"type\":\"text\"},\"name\":\"TimeReset\"}],\"method\":\"thing.service.TimeReset\",\"name\":\"设备校时服务\",\"required\":false,\"callType\":\"async\"}],\"properties\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\",\"accessMode\":\"rw\",\"required\":true},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\",\"accessMode\":\"rw\",\"required\":false}],\"events\":[{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"post\",\"method\":\"thing.event.property.post\",\"name\":\"post\",\"type\":\"info\",\"required\":true,\"desc\":\"属性上报\"},{\"outputData\":[{\"identifier\":\"ErrorCode\",\"dataType\":{\"specs\":{\"0\":\"恢复正常\"},\"type\":\"enum\"},\"name\":\"故障代码\"}],\"identifier\":\"Error\",\"method\":\"thing.event.Error.post\",\"name\":\"故障上报\",\"type\":\"error\",\"required\":true}]}";

const emh_ilop_config_t ilop_config = {
    .tsl_thing = thing,
    .tsl_len = strlen(thing),
    .dm = EMH_ARG_ILOP_DM_ICA_BY_LOCAL,
    .domain = EMH_ARG_ILOP_DOMAIN_SHANGHAI,
};

#endif

const ilop_device_key_t device_key = {
    .product_key = "a1MeLuIJPYL",
    .product_secret = "SegyIuWW6xBQGuIc",
    .device_name = "aQI0eEM5g2nlSr2njD0x",
    .device_secret = "o7EZShzl6z8F3xq8qF3vN9P7HFGslRAV",
};
#endif
static void user_tast_loop(void)
{
    if (awss_start == 1) {
        ilop_awss_start();
        awss_start = 0;
    }
    if (awss_press == 1) {
        ilop_awss_press();
        awss_press = 0;
    }
    if (reset == 1) {
        ilop_restore();
        reset = 0;
    }
}

#ifdef MX_CLI_ENABLE
static void handle_aws_cmd(char* pwbuf, int blen, int argc, char** argv)
{
    if (argc != 2)
        return;

    if (strcmp(argv[1], "start") == 0) {
        awss_start = 1;
    } else if (strcmp(argv[1], "press") == 0) {
        awss_press = 1;
    }
}

static void handle_reset_cmd(char* pwbuf, int blen, int argc, char** argv)
{
    reset = 1;
}

static struct cli_command ilopcmds[] = {
    { "aws", "aws [start|press]", handle_aws_cmd },
    { "reset", "clean wifi module and ilop service", handle_reset_cmd },
};
#endif

void ilop_main(void)
{
    mx_status err = kNoErr;

    /* System initialization， ticker, stdio */
    mx_hal_ms_ticker_init();
    mx_hal_stdio_init();

#ifdef MX_CLI_ENABLE
    cli_register_commands(ilopcmds, sizeof(ilopcmds) / sizeof(struct cli_command));
#endif

    /* ILOP service initialization */
    err = ilop_init(&ilop_config);
    if (err != kNoErr)
        app_log("ilop init err");

    /* Set the ILOP three tuple. If the module is pre burned, delete the function */
    ilop_set_device_key(&device_key);

    /* database initialization */
    ilop_ica_attr_init(ILOP_HANDLE_ATTR_MAX);

    property_register();
    service_register();
    event_register();

    while (1) {
        ilop_runloop();
        user_tast_loop();
        event_task_loop();
    }
}
